{% extends 'layouts/base.html' %}
{% block content %}
<style type="text/css">
    .order_wrap .weui_cell .two_select_box_next_hd{
        vertical-align: top;
        padding-top: 10px;
    }
    .order_wrap .weui_cell .two_select_box{
        float: right;
    }
    .order_wrap .weui_cell .two_select_box .short_select_box{
        float: left;
        position: relative;
    }
    .order_wrap .weui_cell .two_select_box .short_select_box:after{
        content: " ";
        display: inline-block;
        -webkit-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
        transform: rotate(45deg);
        height: 6px;
        width: 6px;
        border-width: 2px 2px 0 0;
        border-color: #C8C8CD;
        border-style: solid;
        position: relative;
        top: -2px;
        position: absolute;
        top: 50%;
        right: 0px;
        margin-top: -3px;
    }
    .order_wrap .weui_cell .two_select_box .short_select_left{
        text-align: right;
        width: auto;
        padding-right: 15px;
        padding-left: 10px;
    }
    .order_wrap .weui_cell .two_select_box .short_select_right{
        text-align: right;
        width: auto;
        padding-right: 15px;
        padding-left: 10px;
    }
    .order_wrap .weui_cell .delect_arrow{
        float: left;
        font-size: 0px;
        width: 18px;
        height: 24px;
        font-size: 16px;
        color:red;
        text-align: center;
        background: url({{config['application']['site']['assetsUri']}}front/images/delect.png) no-repeat left center;
        cursor: pointer;
        }
        .order_wrap .add_arrow_box_wrap{
            overflow: hidden;
        }
        .order_wrap .weui_cell .add_arrow_box{
            width: 115px;
            margin: 0 auto;
            overflow: hidden;
        }
        .order_wrap .weui_cell .add_arrow{
            float: left;
            font-size: 0px;
            width: 18px;
            height: 24px;
            font-size: 16px;
            color:green;
            text-align: center;
            background: url({{config['application']['site']['assetsUri']}}front/images/add.png) no-repeat left center;
            cursor: pointer;
            }
            
            label.error {
                color: red;
                float: none;
            }
            
            .order_wrap .top_txt{
                 vertical-align: top;
            }
            .order_wrap .tips_cell_bd{
                 font-size: 13px;
                 color:#999999;
            }
            .order_wrap .weui_cell .tips_cell_ft input{
                 width: 40px;
            }
            
            .order_wrap .weui_cell .left_top_label_box{
               vertical-align: top;
            }
            .weui_cell .right_select {
                text-align: right;
                float: right;
                width: auto;
                padding-right: 16px;
           }
           
           .invoice_wrap{
               overflow: hidden;
           }
           .invoice_wrap .weui_cells{
               margin-top: 15px;
               font-size: 16px;
           }
           .invoice_wrap .weui_cells .row_cell_two{
               padding: 13px 15px;
               font-size: 16px;
               line-height: 24px;
           }
           .invoice_wrap .weui_cells .row_cell_three{
               padding: 14px 15px;
               font-size: 16px;
               line-height: 24px;
           }
           .invoice_wrap .weui_cells .top_hd{
               padding-top: 8px;
           }
           .invoice_wrap .weui_cells .invoice_btn_box{
               padding-top: 4px;
           }
           .invoice_wrap .weui_cell .weui_cell_hd .text_label{
               width: 6em;
           }
           .invoice_wrap .weui_cells_checkbox .weui_icon_checked:before {
               content: '\EA01';
               color: #C9C9C9;
               font-size: 21px;
               display: block;
           }
           .invoice_wrap .weui_cells .weui_cell_hd .weui_icon_checked:before{
               display: inline-block;
           }
           .invoice_wrap .weui_cells_checkbox .weui_check:checked +.weui_icon_checked:before {
               content: '\EA06';
               color: #FF5402;
           }
           .invoice_wrap .weui_cells .weui_cell_hd .checkbox_icon_tips{
               display: inline-block;
               padding-right: 20px;
               font-size: 15px;
           }
           .invoice_wrap .weui_cell .tips_invoice{
               padding-left: 6px;
               font-size: 12px;
               color: #888888;
           }
           .invoice_wrap .weui_cell .weui_cell_hd{
               overflow: hidden;
           }
           .invoice_wrap .weui_cell .weui_cell_hd .invoice_btn{
               border: 1px solid  #888888;
               color: #333333;
               line-height: 25px;
               font-size: 14px;
               padding: 0 .75em;
               display: inline-block;
               border-radius: 5px;
           }
           .invoice_wrap .weui_cell .weui_cell_hd .invoice_btn.btn_two{
               margin-left: 20px;
           }
           .invoice_wrap .weui_cell .weui_cell_hd .invoice_btn.hover{
               border: 1px solid  #FF5402;
               color: #FF5402;
           }
           .invoice_wrap .btn_box{
               padding: 15px 20px;
           }
           .invoice_wrap .btn_box .submit_btn{
               border-radius: 5px;
               background-color: #FF5402;
           }
           .invoice_wrap .go_top{
               vertical-align: top;
           }


        </style>
        <form action="{{ url('index/order/addMakeOrder') }}" method="post">
            <div id="container" class="bj_color order_wrap">
                <div class="weui_cells weui_cells_form nomargintop">
                    <div class="weui_cell weui_cell_select weui_select_after row_cell">
                        <div class="weui_cell_hd">
                            选择业务
                        </div>
                        <div class="weui_cell_bd weui_cell_primary right_select_box">
                            <select class="weui_select right_select" name="carry_type">
                                {% for v in service %}
                                <option value="{{v.ser_id}}">{{v.ser_name}}</option>
                                {%endfor%}
                            </select>
                        </div>
                    </div>
                    <div class="weui_cell weui_cell_select weui_select_after row_cell">
                        <div class="weui_cell_hd  left_top_label_box">
                            客户类型
                        </div>
                        <div class="weui_cell_bd weui_cell_primary right_select_box">
                            <select class="weui_select right_select" name="client_type">
                                <option value="C">个人</option>
                                <option value="Q">企业</option>
                                <option value="Z">政府</option>
                                <option value="O">其它</option>
                            </select>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd left_top_label_box"><label class="weui_label text_label_3">联系人</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input name="client_name" class="weui_input" type="text" placeholder="请输入您的姓名"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd left_top_label_box"><label class="weui_label text_label_3">手机号</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input name="client_phone" class="weui_input" type="tel" placeholder="请输入手机号"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd left_top_label_box"><label class="weui_label text_label_3">出发地</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input name="start_address" class="weui_input" type="text" placeholder="请输入出发地"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd left_top_label_box"><label class="weui_label text_label_3">目的地</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input name="arrive_address" class="weui_input" type="text" placeholder="请输入目的地"/>
                        </div>
                    </div>
                </div>  
                
                <div class="weui_cells">
                    <div  id ='items' class="weui_cell row_cell">
                        <div class="weui_cell_hd two_select_box_next_hd">
                            <a class="delect_arrow" style="display:none;"></a>大件物品
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <div class="two_select_box">
                                <div class="short_select_box">
                                    <select class="weui_select short_select_left" as="itemCate">
                                        <option value="0">可选</option>
                                        {% for v in itemCate %}
                                        <option value="{{v.ic_id}}">{{v.ic_name}}</option>
                                        {%endfor%}
                                    </select>
                                </div>
                                <div class="short_select_box">
                                    <select class="weui_select short_select_right" as="items" name="items_id[]">
                                        <option value="" price="0.00">请选择</option>
                                    </select>
                                </div>                                         
                            </div>   
                        </div>

                    </div>
                    <div class="weui_cell row_cell_two" id='item_fee_div'>
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>费用</p>
                        </div>
                        <div class="weui_cell_ft">
                            ￥<span class="red_font"  id="item_price" as='fee'>0.00</span>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two add_arrow_box_wrap">
                        <div class="add_arrow_box">
                            <a class="add_arrow" id="add_items"></a>添加大件物品
                        </div>
                    </div>  
                </div>    


                {% for v in type0 %}
                <div class="weui_cells" as="surcharge">          
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd top_txt">
                            {{v.scg_name}}
                        </div>
                        <div class="weui_cell_bd weui_cell_primary tips_cell_bd">
                            <p>（说明：{{v.desciption}}）</p>
                        </div>    
                        <div class="weui_cell_ft tips_cell_ft">
                            <input name="scg_price[]"  unit_price="{{v.scg_price}}" min="0" value="{{v.default_value}}" class="weui_input right_text_input" type="number" placeholder="0"/>
                            {{v.unit}}
                        </div>
                    </div>
                    <input name="default_value[]" value="{{v.default_value}}" type="hidden">
                    <input name="scg_id[]" value="{{v.scg_id}}" type="hidden">
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>费用</p>
                        </div>
                        <div class="weui_cell_ft">
                            ￥<span class="red_font" as='fee'>0.00</span>
                        </div>
                    </div>
                </div>
                {% endfor %}

                <div class="weui_cells">          
                    <div class="weui_cell weui_cell_select weui_select_after row_cell">
                        <div class="weui_cell_hd">
                            出发楼层
                        </div>
                        <div class="weui_cell_bd weui_cell_primary right_select_box">
                            <select class="weui_select right_select" name="scg_id[]" id="address1" >
                                <option value="" price="0.00">请选择</option>
                                {% for v in type1 %}
                                <option value="{{v.scg_id}}" price="{{v.scg_price}}">{{v.scg_name}}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>费用</p>
                        </div>
                        <div class="weui_cell_ft">
                            ￥<span class="red_font" id="address1_price" as='fee'>0.00</span>
                        </div>
                    </div>
                    <div class="weui_cell weui_cell_select weui_select_after row_cell">
                        <div class="weui_cell_hd">
                            到达楼层
                        </div>
                        <div class="weui_cell_bd weui_cell_primary right_select_box">
                            <select class="weui_select right_select" name="scg_id[]" id="address2">
                                <option value="" price="0.00">请选择</option>
                                {% for v in type2 %}
                                <option value="{{v.scg_id}}" price="{{v.scg_price}}">{{v.scg_name}}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>费用</p>
                        </div>
                        <div class="weui_cell_ft">
                            ￥<span class="red_font" id="address2_price" as='fee'>0.00</span>
                        </div>
                    </div>
                </div>
                <div class="weui_cells">          
                    <div class="weui_cell weui_cell_select weui_select_after row_cell">
                        <div class="weui_cell_hd">
                            车辆配备
                        </div>
                        <div class="weui_cell_bd weui_cell_primary right_select_box">
                            <select class="weui_select right_select" name="m_id" id="models">
                                <option value="0.00" price="0.00">请选择</option>
                                {% for v in models %}
                                <option value="{{v.m_id}}" price="{{v.m_fee}}">{{v.m_name}}</option>
                                {%endfor%}
                            </select>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>费用</p>
                        </div>
                        <div class="weui_cell_ft">
                            ￥<span class="red_font" id="models_price" as='fee'>0.00</span>
                        </div>
                    </div>
                </div>
                <div class="weui_cells">          
                    <div class="weui_cell weui_cell_select weui_select_after row_cell_two">
                        <div class="weui_cell_hd top_txt">
                            搬家时间
                        </div>
                        <div class="weui_cell_ft weui_cell_primary">
                            <input name="carrydate" class="weui_input right_text_input" type="date" placeholder="2016-3-14 17:48"/>
                        </div>
                    </div>     
                    <div class="weui_cell font_16">
                        <p>物品详细情况</p>
                        <div class="weui_cell_bd weui_cell_primary">
                            <textarea name="remake" class="weui_textarea" rows="3" placeholder="请描述物品，包裹数量"></textarea>
                        </div>
                    </div>  
                    {%if card != empty%} 
                    <div class="weui_cell weui_cell_select row_cell">
                        <div class="weui_cell_hd">
                           优惠券
                        </div>
                        <div class="weui_cell_bd weui_cell_primary right_select_box">
                            <select class="weui_select right_select" name="card_code" id ='wechat_card'>     
                                    <option value="" >请选择</option>  
                                    {%for v in card%}
                                        <option value="{{v.card_code}}"card_fee="{{v.card_fee}}" cardID="{{v.cardID}}">{{v.card_title}}</option>                               
                                    {%endfor%}
                            </select>
                            <input type="hidden" name="cardID" id="cardID" value=""/>
                        </div>
                    </div>    
                    {%endif%}
                    
                    
                </div> 
                <div class="pay_info">
                    <div class="sum_money">一共费用:<span class="red_font" as="total_price" id="total_price">0.00</span>元 按{{deposit}}%的预约金额：<span class="red_font" id="already_price">0.00</span>元   预约金额最低为{{mini_deposit}}元{%if card != empty%} 优惠立减<span class="red_font"  id="coupon">0.00</span>元{%endif%}</div>
                    <div class="sum_money">余款:<span class="red_font" id="spare_price">0.00</span>元 (根据实际情况或有浮动，订单完成后由搬运人员收取)</div>
                    <div class="padding_box">
                        选择发票: <label class="radio-padding">
                            <input type="radio" name="is_bill" id="Radio1" value="1" checked> 是
                        </label>
                        <label class="">
                            <input type="radio" name="is_bill" id="Radio2" value="0"> 否
                        </label>
                        <p>提示：需要填写发票。备注提醒用户填写后无法更改。</p>
                    </div>
                </div>
                <div class="btn_box">
                    <a id="submit" class="weui_btn submit_btn" href="javascript:">下单</a>
                </div>
            </div>
            
            <div id="container" class="bj_color invoice_wrap">
                <div class="weui_cells  weui_cells_checkbox">
                     <div class="weui_cell row_cell_three">
                        <p>是否开发票</p>
                        <div class="weui_cell_hd top_hd">
                            <label class="" for="radio1">
                                <input type="radio" class="weui_check" name="radio1" id="radio1" checked="checked">
                                <i class="weui_icon_checked"></i>
                                <p class="checkbox_icon_tips">是</p>
                            </label> 
                            <label class="" for="radio2">
                                <input type="radio" class="weui_check" name="radio1" id="radio2" checked="checked">
                                <i class="weui_icon_checked"></i>
                                <p class="checkbox_icon_tips">否</p>
                            </label> 
                        </div>
                    </div>   
                </div> 
                <div class="weui_cells">
                     <div class="weui_cell row_cell_three">
                        <p>发票类型<label class="tips_invoice">（注：专用发票收取17%，普通发票收取6%）</label></p>
                        <div class="weui_cell_hd invoice_btn_box">
                            <span class="invoice_btn hover" >增值税专用发票</span> <span class="invoice_btn btn_two">增值税普通发票</span>
                        </div>
                    </div>   
                </div> 
                <div class="weui_cells">
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">发票抬头</label></div>
                        <div class="weui_cell_bd weui_cell_primary" >
                            <input class="weui_input" type="text" placeholder="请输入公司名称"/>
                        </div>
                    </div>
                </div>
                <div class="weui_cells weui_cells_form">
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">收票人信息</label></div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">纳税识别号</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="text" placeholder="请输入纳税人识别号"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">开户人姓名</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="text" placeholder="请输入开户人姓名"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">户名账号</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="text" placeholder="户名账号"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">收票人手机</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="tel" placeholder="请输入收票人手机"/>
                        </div>
                    </div>
                    <div class="weui_cell row_cell_two">
                        <div class="weui_cell_hd"><label class="weui_label text_label">收票人地址</label></div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="text" placeholder="收票人地址"/>
                        </div>
                    </div>
                </div>
                <div class="btn_box">
                    <a class="weui_btn submit_btn" href="javascript:">确定</a>
                </div>
            </div>   
            {% endblock %}
            {% block script %}
            <script src="{{config['application']['site']['assetsUri']}}front/js/jquery.min.js"></script>
            <script src="{{config['application']['site']['assetsUri']}}admin/js/jquery.validate.min.js"></script>
            <script>
            $(function () {

                //大件物品
                $("#add_items").click(function () {
                    //列表
                    var items = $("#items");
                    var item_price  = $("#item_price");
                    var new_item = items.clone();
                    var select = new_item.find('select[as="itemCate"]');
                    var select2 = new_item.find('select[as="items"]');
                    new_item.find('.red-label').text('0.00');
                    new_item.find('select[as="items"]').empty().append('<option value="0" price="0.00">请选择</option>');
                    set_items(select, select2);
                    $('#item_fee_div').before(new_item);
                    
                    //按钮
                    new_item.find('.delect_arrow').show().click(function(){
                        $(this).parents('#items').remove();
                        total_item_price();
                        total_price();
                    });
                    
                });
                
                
                //优惠券
                $('#wechat_card').change(function(){
                    var value = $(this).find('option:selected').attr('card_fee');
                    var cardID = $(this).find('option:selected').attr('cardID');
                    value = (value/100);
                    if(!isNaN(value)){
                        value+='.00';          
                    }
                    $('#cardID').val(cardID);
                    $('#coupon').text(value);
                });
                
                var accAdd = function (arg1,arg2){  
                    var r1,r2,m;  
                    try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}
                    try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}
                    m=Math.pow(10,Math.max(r1,r2));  
                    return (arg1*m+arg2*m)/m ;
                };

                var total_item_price = function(){                                                              

                    var total_item = $("#item_price");
                    var items  = $('select[as="items"]');
                    var sum  = '0.00';
                    items.each(function(){
                        var price = $(this).find('option:selected').attr('price');
                        sum = accAdd(sum,price);
                    });
                    total_item.text(sum+'.00');
                };


                var set_items = function (obj, obj2) {
                    obj.change(function () {
                        var my = $(this);
                        var ic_id = my.val();
                        var items = obj2;
                        var price = my.siblings(".red-label");
                        price.text('0.00');
                        total_price();
                        if (ic_id != false) {
                            $.ajax({
                                type: "post",
                                url: "{{ url('index/order/getitems')}}",
                                data: "ic_id=" + ic_id,
                                dataType: 'json',
                                success: function (data) {
                                    var str = '<option price="0.00" value="0" >请选择</option>';
                                    if (data != false) {
                                        for (var v in data) {
                                            str += '<option price="' + data[v].price + '" value="' + data[v].item_id + '">' + data[v].item_name + '</option>'
                                        }
                                        
                                        items.unbind().change(function(){
                                            total_item_price();
                                            total_price();
                                        });                                    
                                    }else{
                                        str = '<option price="0.00" value="0" >无选项</option>';
                                    }
                                    items.html(str);
                                }
                            });
                        }else{
                            items.html('<option price="0.00" value="0" >请选择</option>');
                        }

                    });
                };

                set_items($('select[as="itemCate"]'), $('select[as="items"]'));

                $("#submit").click(function () {
                    if($('select[name="m_id"]').val() == '0.00'){
                        alert('请选择车辆配置');return;
                    }
                    $('form').submit();
                });

                var select_price = function (select, price) {
                    select.unbind().change(function () {
                        price.text($(this).find('option:selected').attr('price'));
                        total_price();
                    });
                };

                select_price($('#address2'), $('#address2_price'));
                select_price($('#address1'), $('#address1_price'));
                select_price($('#models'), $('#models_price'));

                var total_price = function () {
                    var mini_deposit = {{mini_deposit}};
                    var spare_price = $("#spare_price");
                    var already_price = $("#already_price");
                    var total = 0;
                    var rate = parseInt("{{deposit}}");
                    $('span[as="fee"]').each(function () {
                        var self_price = parseInt($(this).text());
                        total += self_price;
                    });
                    
                    var price1 = Math.ceil(total*(rate/100));
                    var price2 = total - price1;
                    
                    if(price1 < mini_deposit){
                        price1 = mini_deposit;
                    }

                    $('#total_price').text(total + '.00');
                    already_price.text(price1+".00");
                    spare_price.text(price2+".00");
                };
                
                //附加费
                $('div[as="surcharge"]').each(function(){
                   var self = $(this);
                   var default_value = parseInt(self.find('input[name="default_value[]"]').val());
                   var show_price = self.find('.red_font');
                   var number = self.find('.weui_input');
                   var unit_price = number.attr('unit_price');
                   number.change(function(){
                       var val  = parseInt($(this).val());
                       
//                        if(val<0){
//                            $(this).val(0);
//                            alert("不能小于零");
//                            return false; 
//                        }
                       
                       if(val>default_value){
                          var margin = val - default_value;
                          var result = margin * parseInt(unit_price);
                          show_price.text(result+".00");
                       }else{
                           show_price.text('0.00');
                       }
                       total_price();
                    });
                });
                
                String.prototype.replaceAll = function (str1,str2){
                    var str = this; 
                    var result = str.replace(eval("/"+str1+"/gi"),str2);
                    return result;
                };

                // 手机号码验证
                jQuery.validator.addMethod("isMobile", function (value, element) {
                    var length = value.length;
                    var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
                    return this.optional(element) || (length == 11 && mobile.test(value));
                }, "请正确填写您的手机号码");
                
                jQuery.validator.methods.compareDate = function(value, element) {
                    //var startDate = jQuery(param).val() + ":00";补全yyyy-MM-dd HH:mm:ss格式
                    //value = value + ":00";

                    var startDate = value;
                    var date1 = new Date(Date.parse(startDate.replaceAll("-", "/")));
                    var today  = new Date();
                    return date1 >= today;
                };

                jQuery.validator.methods.maxDate = function(value, element) {
                    var startDate = value;
                    var date1 = new Date(Date.parse(startDate.replaceAll("-", "/")));
                        date1 = date1.getTime();
                    var today  = new Date();
                        today = today.getTime();
                        today  += (3600000*24*7);
                    return date1 <= today;
                };
                
                $("form").validate({
                    rules: {
                        client_name: {
                            required: true,
                            maxlength: 10
                        },
                        client_phone: {
                            required: true,
                            isMobile: true
                        },
                        carrydate: {
                            required: true,
                            compareDate: true,
                            maxDate :true
                        },
                        start_address: {
                            required: true,
                            maxlength: 50
                        },
                        arrive_address: {
                            required: true,
                            maxlength: 50
                        }
                    },
                    messages: {
                        client_name: {
                            required: '请输入您的姓名！',
                            maxlength: '长度不能超过10个字符！'
                        },
                        client_phone: {
                            required: '手机号码不能为空！',
                            isMobile: '请正确填写您的手机号码！'
                        },
                        carrydate: {
                            required: '请输入搬运日期！',
                            compareDate: "搬运日期必须大当前日期！",
                            maxDate :'搬运日期不能大于一周后！'
                        },
                        start_address: {
                            required: '请输入起始地！',
                            maxlength: '不能超过50个字符！'
                        },
                        arrive_address: {
                            required: '请输入目的地！',
                            maxlength: '不能超过50个字符！'
                        }
                    }
                });
                
                
                $(".invoice_btn_box span").click(
                    function(){
                     $(this).addClass("hover").siblings("span").removeClass("hover");
                    }
                );


            });
            </script>
{% endblock %}